#include <iostream>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
    TreeNode(int x) :
            val(x), left(NULL), right(NULL) {
    }
};

class Solution {
public:
    vector<int> tmp;
    void shelper(TreeNode *p){
        if(p==nullptr){
            tmp.push_back(0xffffffff);
        }else{
            tmp.push_back(p->val);
            shelper(p->left);
            shelper(p->right);
        }
    }
    char* Serialize(TreeNode *root) {    
        tmp.clear();
        shelper(root);
        int size=tmp.size();
        int *tp=new int[size];
        for(int i=0;i<size;i++){
            tp[i]=tmp[i];
        }
        return (char *)tp;
    }
    TreeNode* dhelper(int *&p){
        if(*p==0xffffffff){
            p++;
            return NULL;
        }
        TreeNode* res=new TreeNode(*p);
        p++;
        res->left=dhelper(p);
        res->right=dhelper(p);
        return res;
    }
    TreeNode* Deserialize(char *str) {
        int *tp=(int *)str;
        return dhelper(tp);
    }
};






int main(){
    
    return 0;
}